Fix island-based evolution not distributing programs across islands#392
Merged
Fix island-based evolution not distributing programs across islands#392
Conversation
Fix issue #391 by ensuring children are placed in the intended target island instead of inheriting the parent's island. Add target_island to SerializableResult, capture sampling_island in the worker, and pass result.target_island into database.add when inserting child programs. Update tests to reflect the fixed behavior (children go to the target island) and add regression tests that demonstrate the old buggy behavior when target_island is not provided and the correct behavior when it is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue #391 where all evolved programs were placed in Island 0 instead of being distributed across configured islands.
Root Cause
When sampling from an empty island,
sample_from_island()falls back to sampling from any available program (typically from Island 0). Children then inherited their parent's island viadatabase.add(), creating a feedback loop where all programs ended up in Island 0.Fix
target_islandfield toSerializableResultsampling_islandfrom the snapshot in the resultProcessParallelControllerpassestarget_islandtodatabase.add()when processing resultsThis ensures children are placed in the intended target island, not the parent's island.
Changes
openevolve/process_parallel.py: Addedtarget_islandto result and pass it todatabase.add()tests/test_island_child_placement.py: Comprehensive tests for island placement behaviorTest Plan
Closes #391
🤖 Generated with Claude Code